#ifndef HELPER_H_
#define HELPER_H_

#include <string>
#include <sstream>
using namespace std;

class Helper {
public:
	template <typename T>
	static string fix_length(T t, int num_char) {
		stringstream ss;

		// Conver t to string
		ss << t;

		// Calculate number space to appened
		int num_space = num_char - ss.str().length();

		if (num_space <= 0) {
			// Number space is negatif
			return ss.str().substr(0, num_char);
		}

		// Append Space
		for (int i = 0; i < num_space; ++i) {
			ss << " ";
		}

		return ss.str();
	}
};

#endif // HELPER_H_